package com.bluejie.springBoot.service;

import com.bluejie.springBoot.dao.UserDao;
import com.bluejie.springBoot.entity.business.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Optional;

/**
 * Created by bluej on 2018-03-18.
 */
@Service("userService")
public class UserService implements BaseService<User> {
    @Autowired
    private UserDao userDao;

    @Override
    public User getById(Integer id) {
        return userDao.findById(id).get();
    }

    public User getByName(String name){
        return userDao.getUserByName(name);
    }


    public User getUserByNameAndStatus(String name,int status){
        return userDao.getUserByNameAndStatus(name,status);
    }
}
